<template>
    <div class="friend">
        <div class="site-content">
            <section-title>
                <div class="friend-header">
                    <div class="title">
                        <router-link to="/rootView/friends">/友链申请</router-link> 
                        <router-link to="/rootView/creation">/创作中心</router-link>
                        <router-link to="/rootView/nodeSystem">/文章管理</router-link></div>
                    </div>
            <hr>
            </section-title>
            <!---内容区域--->
            <div class="statement">
               <router-view></router-view>
            </div>
        </div>
    </div>
</template>

<script>
    import sectionTitle from '@/components/section-title'
    import Quote from "@/components/quote";
    import {fetchFriend} from '../api'
    export default {
        name: "Friend",
        data(){
          return{
              websiteInfo: {},
              list: [
                  {
                  id:1,
                  path:"",
                  siteName:"北辞",
                  desc:"努力登上金色的舞台成为全场的焦点"
                   },
                  {
                  id:2,
                  path:"",
                  siteName:"胡航",
                  desc:"失了智的小学生"
                   },
              ]
          }
        },
        components:{
            Quote,
            sectionTitle
        },
        methods: {
            getWebSiteInfo(){
                this.$store.dispatch('getSiteInfo').then(data =>{
                    this.websiteInfo = data
                })
            },
            getSiteAll(){
                 this.$http.get("/getSiteAll").then((va)=>{
                    if(va.data.code==200){
                        this.list=va.data.object
                    }else{
                        this.$message({
                            message: '拉取错误',
                            type: 'warning'
                        });
                    }
                })
            }
        },
        mounted() {
            this.getWebSiteInfo();
            this.getSiteAll()
        }
    }
</script>

<style scoped lang="less">
    .friend{
        padding-top: 40px;
    }
    .friend-header{
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 80px;
        font-weight: 400;
        .title{
            font-size: 15px;
            color: royalblue;
        }
        .apply:hover{
            color: #ff6d6d;
        }
    }
    .statement{
        margin: -20px 0 20px 0;
        a{
            color: #ff6d6d;
        }
        p{
            line-height: 2rem;
        }
    }
    hr{
        margin: 40px 0;
        border: 0;
        height: 1px;
        background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(255, 109, 109, 0.75), rgba(0, 0, 0, 0));
    }
    .friend-list{
        width: 100%;
        .friend-item{
            display: inline-block;
            width: 30%;
            /*height: 100px;*/
            margin: 0 5% 20px 0;
            padding: 10px 30px;
            border: 1px solid #ECECEC;
            border-radius: 3px;
            // border-bottom: 2px solid rgb(30, 122, 158);
            &:hover{
                box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
            }
            &:nth-of-type(3n){
                margin-right: 0;
            }
            .site-name,.site-detail{
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                padding-bottom: 10px;
                line-height: 1.5rem;
            }
            .site-name{
                color: #8fd0cc;
                border-bottom: 1px dotted #ECECEC;
            }
            .site-detail{
                font-size: 13px;
                padding-top: 10px;
            }
        }
    }
    /*******/
    @media (max-width: 800px) {
        .friend-header{
            margin-top: 0;
        }
        .friend-list{
            .friend-item{
                width: 45%;
                &:nth-of-type(2n){
                    margin-right: 0;
                }
                &:nth-of-type(3n){
                    margin-right: 5%;
                }
            }
        }
    }
    @media (max-width: 600px){
        .friend-list{
            .friend-item{
                display: block;
                width: 90%;
                margin: 0 auto 20px auto;
                &:nth-of-type(2n){
                    margin-right: auto;
                }
                &:nth-of-type(3n){
                    margin-right: auto;
                }
            }
        }
    }
</style>
